//
// Created by yunnan xu on 2021/1/15.
//

#ifndef ANDROIDGRAPHICSDEMOS_POSTPROCESSPASS_H
#define ANDROIDGRAPHICSDEMOS_POSTPROCESSPASS_H

#include "Pass.h"
#include <unordered_map>
#include <string>
#include <EGL/egl.h>
#include <GLES3/gl32.h>
#include "GLESUtils.h"
#include <memory>


template<GraphicsAPI API> class PostProcessPass;
template <GraphicsAPI> class Texture2D;


template<> class PostProcessPass<GraphicsAPI::GLESv3> : public GLESPass
{
public:
    PostProcessPass();
    virtual ~PostProcessPass() = default;
    virtual void Draw();

protected:
    virtual void InitShaderUniformLocation();

private:

    int width;
    int height;
    GLuint framebuffer;
    std::shared_ptr<Texture2D<GraphicsAPI::GLESv3>> framebufferTexture;

};


#endif //ANDROIDGRAPHICSDEMOS_POSTPROCESSPASS_H
